package com.wyix.coffee.service;

import com.wyix.coffee.bean.CoffeeMaker;

/**
 * @author wangdx
 * @since 2025/8/6
 */
public class BaristaFieldInjection {
    // 字段注入（手动赋值）
    public CoffeeMaker coffeeMaker;

    public String serveCoffee() {
        if (coffeeMaker == null) {
            throw new IllegalStateException("未设置咖啡机！");
        }
        return "咖啡师（字段注入）服务：" + coffeeMaker.makeCoffee();
    }
}